//
// Created by yycs0 on 25-2-6.
//

#ifndef WATER_SORT_WATERSORT_H
#define WATER_SORT_WATERSORT_H
#include <vector>
#include <array>
#include <queue>
#include <cstdio>
#include <set>
#include <string>
#include <fstream>

struct State
{
    int cup_num   = 4;
    int capacity  = 4;
    int empty_cup = 1;
    std::vector<std::vector<int>> water;
};

struct ActionState
{
    State state;
    std::array<int ,2> action = {0,0};
};
struct PathState
{
    State state;
    std::vector<std::array<int ,2>> actions;
};
State generateRandomState(int cup_num, int empty_cup, int stepnum);
State loadStateFromFile(std::string filename);
State loadStateFromString(std::string str);
bool isAction(int a, int b, const State &cur_state);
State move(std::array<int,2> action, const State &cur_state);
bool astar(State state, std::vector<std::array<int ,2>> &result);
bool bfs(State state, std::vector<std::array<int ,2>> &result);
#endif //WATER_SORT_WATERSORT_H
